package one.three.one;

public class FixedCapactityStackOfStrings {
	private String[] a;
	private int N;

	public FixedCapactityStackOfStrings(int cap) {
		a = new String[cap];
	}

	public boolean isEmpty() {
		return N == 0;
	}

	public int size() {
		return N;
	}

	public void push(String item) {
		a[N++] = item;
	}

	public String pop() {
		return a[--N];
	}

	public boolean isFull() {
		if (N == a.length) {
			return true;
		}
		return false;
	}

	public static void main(String[] args) {
		FixedCapactityStackOfStrings s = new FixedCapactityStackOfStrings(5);
		s.push("jim");
		s.push("jim");
		s.push("jim");
		s.push("jim");
		s.push("jim");
		System.out.println(s.isFull());
	}

}
